import http from "@/api";
import { MENU_PORT } from "@/api/config/servicePort";
import { ResPage } from "@/api/interface";

export const getMenuList = (params: Menu.ReqMenuParams) => {
  return http.post<ResPage<Menu.MenuOptions>>(MENU_PORT + `/list`, params);
};

export const getAllMenuList = () => {
  return http.get<Menu.MenuOptions[]>(MENU_PORT + `/all_list`);
};

export const addMenu = (params: { id: string }) => {
  return http.post(MENU_PORT + `/add`, params);
};

export const editMenu = (params: { id: string }) => {
  return http.put(MENU_PORT + `/edit`, params);
};

export const deleteMenu = (params: { ids: string[] }) => {
  return http.post(MENU_PORT + `/delete`, params);
};
